package com.cai.servlet.common.user.log;

import com.cai.dao.MessageDao;
import com.cai.dao.impl.MessageDaoImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author RuoLi
 * 删除帮助信息
 */
@WebServlet(name = "ServletDeleteMessage", value = "/common/log/DeleteMessage")
public class ServletDeleteMessage extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        MessageDao messageDao = new MessageDaoImpl();
        String tipId = req.getParameter("tipId");
        resp.getWriter().write(String.valueOf(messageDao.deleteMessage(Integer.parseInt(tipId))));
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }
}
